﻿namespace MicroCloud.Systems.Entities
{
    /// <summary>
    /// 实体类：字典数据 基类
    /// </summary>
    public abstract class DictEntryBase<TKey, TDictKey> : EntityBase<TKey>, ILockable, ICreatedTime, IUpdatedTime
        where TKey : struct, IEquatable<TKey>
        where TDictKey : struct, IEquatable<TDictKey>
    {
        /// <summary>
        /// 获取或设置 字典编码
        /// </summary>
        [Required]
        [DisplayName("字典编码")]
        [StringSize(StringSizeType.Code)]
        public TDictKey DictId { get; set; }

        /// <summary>
        /// 获取或设置 编码名称
        /// </summary>
        [Required]
        [StringSize(StringSizeType.Name)]
        [DisplayName("编码名称")]
        public string CodeName { get; set; }

        /// <summary>
        /// 获取或设置 编码值
        /// </summary>
        [DisplayName("编码值")]
        public int CodeValue { get; set; }

        /// <summary>
        /// 获取或设置 备注
        /// </summary>
        [DisplayName("备注")]
        [StringSize(StringSizeType.Remark)]
        public string Remark { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        [DisplayName("排序号")]
        public int OrderNo { get; set; }

        #region 接口字段        
        /// <summary>
        /// 获取或设置 是否锁定
        /// </summary>
        [DisplayName("是否锁定")]
        public bool IsLocked { get; set; }

        /// <summary>
        /// 获取或设置 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 获取或设置 更新时间
        /// </summary>
        [DisplayName("更新时间")]
        public DateTime? UpdatedTime { get; set; }

        #endregion
    }
}